/*    */ package com.qmsk.business.store.storedRule.dao;
/*    */ 
/*    */ import com.qmsk.business.sys.basic.SupportDAO;
/*    */ import com.utils.basic.ObjectComm;
/*    */ import com.utils.gson.in.GsonHeadManyRows;
/*    */ import com.utils.gson.out.GsonEbRst;
/*    */ import java.sql.SQLException;
/*    */ import java.util.ArrayList;
/*    */ import java.util.HashMap;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class StoredRuleDao extends SupportDAO
/*    */ {
/*    */   public GsonEbRst getGsonOfAll(Map<String, Object> params, Integer nPageIdx, Short nPageSize)
/*    */     throws SQLException
/*    */   {
/* 23 */     return getGsonOfParams("selectSqlOfAll", params, nPageIdx, nPageSize, 
/* 24 */       true);
/*    */   }
/*    */ 
/*    */   public GsonEbRst getGsonOfId(Map<String, Object> params) throws SQLException
/*    */   {
/* 29 */     return getGsonOfParams("selectSqlOfAll", params, false);
/*    */   }
/*    */ 
/*    */   public int updateStoreRuleStatus() throws SQLException {
/* 33 */     Map params = getSelectStatusIdList();
/* 34 */     return update("updateStoreRuleStatus", params);
/*    */   }
/*    */ 
/*    */   private Map<String, Object> getSelectStatusIdList() throws SQLException {
/* 38 */     Map params = null;
/* 39 */     GsonHeadManyRows g = getManyRowsOfParams("selectSqlIdList", 
/* 40 */        new Object[]{});
/* 41 */     if ((g != null) && (g.isExistsData())) {
/* 42 */       List list = new ArrayList();
/* 43 */       for (int i = 0; i < g.getDataLength(); ++i) {
/* 44 */         Long id = ObjectComm.objectToLong(g.getValueOfName("id", i));
/* 45 */         if (id != null) {
/* 46 */           list.add(id);
/*    */         }
/*    */       }
/* 49 */       if (list.size() > 0) {
/* 50 */         params = new HashMap();
/* 51 */         params.put("ids", list);
/*    */       } else {
/* 53 */         params = new HashMap();
/*    */       }
/*    */     } else {
/* 56 */       params = new HashMap();
/*    */     }
/* 58 */     return params;
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\鏂板缓鏂囦欢澶筡WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.store.storedRule.dao.StoredRuleDao
 * JD-Core Version:    0.5.3
 */